﻿using DevTeam;

using System;
namespace ConfExpert.Forms.Depo
{
    public partial class Equiv : XPopupForm
    {
        int ProductId;
        public Equiv(int _ProductId)
        {
            InitializeComponent();
            ProductId = _ProductId;
        }

        private void Equiv_Load(object sender, EventArgs e)
        {
            gridView1.Init("GetEquiv", ProductId);
            gridView1.AddDetailGrid(gridView2, "ProductId");

            gridView1.MakeReadOnly();
            gridView2.MakeReadOnly();
            gridView1.FormatAsNumber(1, "TotalQty", "IdleQty");
            gridView1.AddSummary("TotalQty", "IdleQty");
            gridView2.FormatAsNumber(1, "Qty");
            gridView2.AddSummary("Qty");
            gridView1.BestFitColumns();
            gridView2.BestFitColumns();

            gridView1.FocusedRowChanged += gridView1_FocusedRowChanged;
            splitContainerControl1.AutoSize();
        }

        void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            gridView2.BestFitColumns();
        }
    }
}
